@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-image: url('../imgs/background.jpg'); /* Replace with your background image */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    color: #4B5563;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    max-width: 700px;
    width: 100%;
    margin: 20px;
    padding: 0;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    animation: fadeInDown 0.8s ease-out;
}

.nav-brand h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-1px);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-item svg {
    transition: transform 0.3s ease;
}

.nav-item:hover svg {
    transform: scale(1.1);
}

header {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 80px;
    color: white;
    animation: fadeInDown 0.8s ease-out;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -1px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.85;
}

main {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 35px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    margin-bottom: 30px;
    transform: translateY(0);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

main:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3);
}

.form-container {
    animation: fadeInUp 0.8s ease-out;
}

.form-container h2 {
    margin-bottom: 25px;
    color: #4F46E5;
    font-size: 1.4rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

input[type="text"], textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
    background-color: #F9FAFB;
}

input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: #4F46E5;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.export-options {
    margin: 25px 0;
}

.export-options h3 {
    margin-bottom: 15px;
    color: #374151;
    font-weight: 600;
}

.checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    font-weight: 500;
    position: relative;
    padding-left: 30px;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #eee;
    border-radius: 4px;
    transition: all 0.3s;
}

.checkbox-label:hover input ~ .checkbox-checkmark {
    background-color: #ccc;
}

.checkbox-label input:checked ~ .checkbox-checkmark {
    background-color: #4F46E5;
}

.checkbox-checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-label input:checked ~ .checkbox-checkmark:after {
    display: block;
}

.checkbox-label .checkbox-checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}


.primary-btn {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(45deg, #4F46E5, #818CF8);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.primary-btn .btn-text {
    transition: all 0.2s ease;
}

.primary-btn .loading-spinner {
    position: absolute;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.primary-btn.loading .btn-text {
    opacity: 0;
    transform: translateY(-10px);
}

.primary-btn.loading .loading-spinner {
    opacity: 1;
    transform: scale(1);
}


.primary-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-container, .results-container {
    margin-top: 30px;
    padding: 25px;
    background: #F9FAFB;
    border-radius: 16px;
    animation: fadeInUp 0.5s ease-out forwards;
    display: none; /* Initially hidden */
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #E5E7EB;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4F46E5, #818CF8);
    border-radius: 5px;
    transition: width 0.4s ease-in-out;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: #4B5563;
    font-weight: 500;
}

.results-container h3 {
    margin-bottom: 20px;
    color: #111827;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 10px;
    border: 1px solid #E5E7EB;
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateX(5px);
    border-left-color: #4F46E5;
}

footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    padding: 20px;
    animation: fadeInUp 1s ease-out 0.5s backwards;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 结果统计样式 */
.results-stats {
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    text-align: center;
}

.stat-item {
    padding: 15px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 500;
}

.stat-total .stat-number { color: #6B7280; }
.stat-success .stat-number { color: #10B981; }
.stat-failed .stat-number { color: #EF4444; }
.stat-time .stat-number { color: #3B82F6; }

/* 结果表格样式 */
.results-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.results-table thead {
    background: rgba(79, 70, 229, 0.2);
}

.results-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.results-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: middle;
}

.result-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.result-row:last-child td {
    border-bottom: none;
}

/* 状态徽章样式 */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-badge.status-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.status-failed {
    background: rgba(239, 68, 68, 0.2);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-icon {
    font-weight: bold;
    font-size: 1rem;
}

/* 组件ID样式 */
.component-id {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 600;
    color: #4F46E5;
    background: rgba(79, 70, 229, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* 文件数量样式 */
.file-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: rgba(59, 130, 246, 0.2);
    color: #3B82F6;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* 消息文本样式 */
.message-text {
    color: #6B7280;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 列宽度控制 */
.col-status { width: 120px; }
.col-component { width: 150px; }
.col-files { width: 100px; text-align: center; }
.col-message { width: auto; }

@media (max-width: 768px) {
    .container {
        margin: 10px;
    }
    main {
        padding: 20px;
    }
    header h1 {
        font-size: 2.2rem;
    }
    
    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .results-table {
        font-size: 0.85rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 6px;
    }
    
    .col-status { width: 80px; }
    .col-component { width: 120px; }
    .col-files { width: 60px; }
    
    .status-badge {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .component-id {
        font-size: 0.8rem;
        padding: 2px 6px;
    }
}

/* BOM Upload Styles */
.bom-upload-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.bom-upload-section h4 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.file-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.file-upload-area:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.file-upload-area.dragover {
    border-color: #3B82F6;
    background: rgba(59, 130, 246, 0.1);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.upload-content p {
    color: white;
    margin: 5px 0;
}

.file-info {
    font-size: 0.9rem;
    opacity: 0.7;
}

.file-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.file-status.success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22C55E;
}

.file-status.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #EF4444;
}

.file-status.processing {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3B82F6;
}